/*
 * @Author: ygl
 * @Date: 2021-12-24 11:11:48
 * @LastEditors: ygl
 * @LastEditTime: 2021-12-27 14:52:44
 * @Description: file content
 */

export default class resetChart {
  constructor(chart) {
    this.chart = chart
  }
  resetSize() {
    window.addEventListener('resize', () => {
      if (this.chart) {
        this.chart.resize()
      }
    })
    let sidebarElm = document.getElementsByClassName('sidebar-container')[0]
    sidebarElm &&
      sidebarElm.addEventListener('transitionend', (e) => {
        if (e.propertyName === 'width') {
          if (this.chart) {
            this.chart.resize()
          }
        }
      })
  }
}
